package org.example.myleet.p705;

import java.util.Arrays;

/**
 * 46 ms
 */
class MyHashSet {

    private int[] values = new int[1000001];

    /** Initialize your data structure here. */
    public MyHashSet() {
        Arrays.fill(values, 0);
    }

    public void add(int key) {
        if (values[key] == 0) {
            values[key] = 1;
        }
    }

    public void remove(int key) {
        if (values[key] > 0) {
            values[key] = 0;
        }
    }

    /** Returns true if this set contains the specified element */
    public boolean contains(int key) {
        if (values[key] > 0) {
           return true;
        }
        return false;
    }
}
